Skip to content

GCP VPC Support and Unit Test fix #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Conversation

bao1018
Copy link
Contributor

@bao1018 bao1018 commented Dec 3, 2019

This PR include below changes:

  1. Add GCP vpc support
  2. Fix the unit test in compileFunction.test.js

Related Issue:
#190

Other reference:
https://cloud.google.com/functions/docs/connecting-vpc
https://github.com/googleapis/google-api-nodejs-client/blob/master/src/apis/cloudfunctions/v1.ts#L272

@bao1018 bao1018 changed the title issue 130: GCP VPC Support and Unit Test fix GCP VPC Support and Unit Test fix Dec 3, 2019
@bao1018
Copy link
Contributor Author

bao1018 commented Dec 10, 2019

@pmuens we have over 50+ cloud functions blocked by this feature in PRODUCTION, can you prioritize this PR and help to merge this. please let me know if you have any feedback on committed code, we will address immediately. thanks so much!

@medikoo medikoo requested a review from pmuens January 28, 2020 11:05
Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bao1018 thanks for working on this 👍

LGTM :shipit:

@pmuens pmuens merged commit 930987c into serverless:master Jan 28, 2020
@pmuens
Copy link
Contributor

pmuens commented Jan 28, 2020

Just created a new release which should be available via npm shortly...

@mayurdanger
Copy link

Is this added to release?
if yes how to add it to my serverless.yam file.
Can someone guide me?
Thanks

@deemetree-at-satelligence
Copy link

deemetree-at-satelligence commented Oct 13, 2020

@mayurdanger I've managed to set it up like this, but had issues adding it to an existing deployment, which required me to delete and redeploy the service. But maybe that was something temporary and wouldn't be a problem for you.

functions:
  <YOUR FUNCTION NAME>:
    handler: <YOUR FUNCTION HANDLER>
    vpc: <YOUR VPC CONNECTOR, e.g. "projects/${self:provider.project}/locations/${self:provider.region}/connectors/<YOUR CONNECTOR NAME>">
    events:
      - http: path

Here's some more info about VPC Connectors: Creating a connector and Connecting CF to VPC

Looking at the code it's also possible to specify the connector on the provider level (this PR's diffs), but I haven't tried that.

Hope this helps ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants